package com.thalesgroup.preferenceFramework.models.LCPnet.profiling;

import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;

import com.thalesgroup.preferenceFramework.models.LCPnet.LCPnet;
import com.thalesgroup.preferenceFramework.models.LCPnet.exceptions.LCPnetEvaluationException;
import com.thalesgroup.preferenceFramework.models.LCPnet.impl.LCPnetImpl;

public class LCPnetsProfiling {

	static LCPnet loadLCPnetX() {
		return LCPnetImpl.load("tests/com/thalesgroup/preferenceFramework/models/LCPnet/profiling/lcpnet_test.lcpnet");

	}
	
	static void getUtilityLCPnetX(LCPnet lcpnet) throws LCPnetEvaluationException {
		EList<String> nodeNames = new BasicEList<String>();
		nodeNames.add("S");
		nodeNames.add("B");
		nodeNames.add("R");
		
		EList<Double> nodeValues = new BasicEList<Double>();
		nodeValues.add(0.4);
		nodeValues.add(1.0);
		nodeValues.add(0.51);
		
		System.out.println(lcpnet.getUtility(nodeNames, nodeValues));
	}
	
	
	static LCPnet loadLCPnetCLPT() {
		return LCPnetImpl.load("tests/com/thalesgroup/preferenceFramework/models/LCPnet/profiling/profiling_CLPT.lcpnet");

	}
	
	static void getUtilityLCPnetCLPT(LCPnet lcpnet) throws LCPnetEvaluationException {
		EList<String> nodeNames = new BasicEList<String>();
		nodeNames.add("A");
		nodeNames.add("B");
		nodeNames.add("C");
		
		EList<Double> nodeValues = new BasicEList<Double>();
		nodeValues.add(0.4);
		nodeValues.add(1.0);
		nodeValues.add(0.51);
		
		System.out.println(lcpnet.getUtility(nodeNames, nodeValues));
	}
	
	
	static LCPnet loadLCPnet1() {
		return LCPnetImpl.load("tests/com/thalesgroup/preferenceFramework/models/LCPnet/profiling/profiling_1.lcpnet");

	}
	
	static void getUtilityLCPnet1(LCPnet lcpnet) throws LCPnetEvaluationException {
		EList<String> nodeNames = new BasicEList<String>();
		nodeNames.add("A");
		
		EList<Double> nodeValues = new BasicEList<Double>();
		nodeValues.add(0.4);
		
		System.out.println(lcpnet.getUtility(nodeNames, nodeValues));
	}
	
	
	static LCPnet loadLCPnet2() {
		return LCPnetImpl.load("tests/com/thalesgroup/preferenceFramework/models/LCPnet/profiling/profiling_2.lcpnet");

	}
	
	static void getUtilityLCPnet2(LCPnet lcpnet) throws LCPnetEvaluationException {
		EList<String> nodeNames = new BasicEList<String>();
		nodeNames.add("A");
		nodeNames.add("B");
		
		EList<Double> nodeValues = new BasicEList<Double>();
		nodeValues.add(0.4);
		nodeValues.add(0.36);
		
		System.out.println(lcpnet.getUtility(nodeNames, nodeValues));
	}
	
	
	static LCPnet loadLCPnet3() {
		return LCPnetImpl.load("tests/com/thalesgroup/preferenceFramework/models/LCPnet/profiling/profiling_3.lcpnet");

	}
	
	static void getUtilityLCPnet3(LCPnet lcpnet) throws LCPnetEvaluationException {
		EList<String> nodeNames = new BasicEList<String>();
		nodeNames.add("A");
		nodeNames.add("B");
		nodeNames.add("C");
		
		EList<Double> nodeValues = new BasicEList<Double>();
		nodeValues.add(0.4);
		nodeValues.add(0.36);
		nodeValues.add(0.90);
		
		System.out.println(lcpnet.getUtility(nodeNames, nodeValues));
	}
	
	
	static LCPnet loadLCPnet10() {
		return LCPnetImpl.load("tests/com/thalesgroup/preferenceFramework/models/LCPnet/profiling/profiling_10.lcpnet");

	}
	
	static void getUtilityLCPnet10(LCPnet lcpnet) throws LCPnetEvaluationException {
		EList<String> nodeNames = new BasicEList<String>();
		nodeNames.add("A");
		nodeNames.add("B");
		nodeNames.add("C");
		nodeNames.add("D");
		nodeNames.add("E");
		nodeNames.add("F");
		nodeNames.add("G");
		nodeNames.add("H");
		nodeNames.add("I");
		nodeNames.add("J");
		
		EList<Double> nodeValues = new BasicEList<Double>();
		nodeValues.add(0.4);
		nodeValues.add(0.36);
		nodeValues.add(0.90);
		nodeValues.add(0.10);
		nodeValues.add(0.20);
		nodeValues.add(0.30);
		nodeValues.add(0.40);
		nodeValues.add(0.50);
		nodeValues.add(0.60);
		nodeValues.add(0.70);
		
		System.out.println(lcpnet.getUtility(nodeNames, nodeValues));
	}
	
	
	
	public static void main(String[] args) throws LCPnetEvaluationException {
		
		LCPnet lcpnet_test = loadLCPnetCLPT();
		getUtilityLCPnetCLPT(lcpnet_test);
	}
	
}
